{extend name="layout/main-block" /}
<!-- main content start -->
{block name="content"}
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">修改视频</a></li>
            </ol>

        </div>
        <div class="row content-main">
            <div class="col-sm-12 col-md-6">
                <form class="form-horizontal" action="{:url('backend/voices/voices_update',['id'=>$id])}" enctype="multipart/form-data" method="post">
                    <input type="hidden" name="type_id" class="form-control" id="inputType_id" value="{$voices.type_id}">
                    <div class="form-group">
                        <label for="inputVio_name_cn" class="col-sm-3 col-md-4 col-lg-3 control-label">视频标题中文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_name_cn" class="form-control" id="inputVio_name_cn" value="{$voices.vio_name_cn}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputVio_name_en" class="col-sm-3 col-md-4 col-lg-3 control-label">视频标题英文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_name_en" class="form-control" id="inputVio_name_en" value="{$voices.vio_name_en}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputVio_intro_cn" class="col-sm-3 col-md-4 col-lg-3 control-label">视频简介中文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_intro_en" class="form-control" id="inputVio_intro_cn" value="{$voices.vio_intro_cn}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputVio_intro_en" class="col-sm-3 col-md-4 col-lg-3 control-label">视频简介英文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="vio_intro_en" class="form-control" id="inputVio_intro_en" value="{$voices.vio_intro_en}">
                        </div>
                    </div>
                    {if condition="$voices.img_url neq ''" }
                    <div class="form-group">
                        <div class="col-sm-9 col-sm-offset-4">
                            <img src="{$voices.img_url}" alt="" width="200">
                        </div>
                    </div>
                    {/if}
                    <div id="img" class="form-group">
                        <label for="inputImg_url" class="col-sm-3 col-md-4 col-lg-3 control-label">视频图片</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input id="inputImg_url" name="image[]" type="file"  value="浏览" >
                        </div>
                    </div>
                    <div class="form-group ">
                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">视频</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <select id="local" name="choose" id="choose_select" class="form-control">
                                {volist name="choose" id="v" empty="$empty" }
                                <option value="{$v}"  {if condition="$v eq $vio_select"}selected="selected"{/if} >{$v}</option>
                                {/volist}
                            </select>
                            <input type="text" name="vioce_url" class="form-control" id="inputVioce_url" value="{$voices.vioce_url}">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-9">
                            <button type="submit" class="btn btn-primary">保 存</button>
                            <input type="hidden" id="img_type" name="img_type" value="4">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
</section>
{/block}

{block name="javascript"}
<script>
    $(function (){
        var type_id = '{$type_id}';
        if(type_id ==3){
            $("#inputVioce_url").hide();
            $("#local").show();
        }else if(type_id == 4){
            $("#local").hide();
            $("#inputVioce_url").show();
        }
     /*$("#choose").click(function (){
     $.ajax({
     url:'{:url("voices/voices_choose")}',
     success: function (data){

     console.log(data);
     }
     });
     });*/
     });
</script>
{/block}

